# Create your views here.
from django.shortcuts import render_to_response
from django.shortcuts import redirect
from django.core.context_processors import csrf
import time
import random
import urllib

def unprotected(request):
    content = {}
    return render_to_response("Lab7/unprotected.html", content)

def unprotectedAdmin(request):
    content = {}
    return render_to_response("Lab7/unprotected.admin.html", content)

def unprotectedSuperAdmin(request):
    content = {}
    return render_to_response("Lab7/unprotected.superadmin.html", content)

def indentifier(request):

    content = {}

    if 'id' in request.GET:

        if request.GET['id'] == '1331':
            content['doc'] = "You can do anything, but not everything."
        elif request.GET['id'] == '8430298423':
            content['doc'] = "Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away."
        elif request.GET['id'] == '54354':
            content['doc'] = "The richest man is not he who has the most, but he who needs the least."
        elif request.GET['id'] == '0':
            content['doc'] = "the PIN for 1231-3124-5547-2135 is 1234"
        elif request.GET['id'] == '1':
            content['doc'] = "Password for root is toor"

    return render_to_response("Lab7/indentifier.html", content)

def staticfiles(request):
    content = {}
    return render_to_response("Lab7/staticfiles.html", content)

def parameter(request):
    content = {}

    if 'admin' in request.GET and request.GET['admin'] == 'true':
        content['message'] = "Welcome back, Administrator."
    else:
        content['message'] = "Weclome Guest."

    return render_to_response("Lab7/parameter.html", content)


